{extend name="public/base"/}
{block name="style"}
<link href="__PUBLIC__/ieasy/css/classify.css?v=2.1.49" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/ieasy/css/recharge_record.css" rel="stylesheet" type="text/css">

{/block}
{block name="body"}
<div id="console_main"></div>
<div class="head_tit_box">
	<a href="javascript:;" class="head_return_page_but"></a>
		<div class="head_menu_but_box">
		<a href="javascript:;" class="head_menu_but"></a>
	</div>
		<h1>充值记录</h1>
</div>
<!--导航-->
{block name="include"}{include file="public:dropnav" /}{/block}
<div class="body_sytle">
	<div class="rrr_list">
		<ul class="rrr_list_ul" id="tj1">

		</ul>
	</div>
</div>
<script type="text/html" id="list1">
	<% for(var i = 0; i < data.length; i++){ %>
	<li>
		<a href="javascript:;">
			<div class="rrr_li_txt">
				<div class="rrr_li_txt_tit"><strong><%= data[i]['out_trade_no'] %></strong><span>￥<%= data[i]['money'] %></span></div>
				<div class="rrr_li_txt_p"><strong>日期：<%= data[i]['create_time'] %></strong><span><%= data[i]['status'] %></span></div>
			</div>
		</a>
	</li>
	<% } %> 
</script>
{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.min.js?v=2.1.49"></script>
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.cookie.min.js?v=2.1.49"></script>

<!-- 这是zepto插件 -->

<script type="text/javascript" src="__PUBLIC__/ieasy/js/common.js?v=2.1.49"></script>
<script type="text/javascript" src="__PUBLIC__/ieasy/js/cps_log.js?v=2.1.49"></script>

<script type="text/javascript">
$(function () {
$.ajax({
	url: '/api/user/paylog/?page=1',
	type: 'post',
	success: function (data) {
		if (data.code === 200) {
			var banner=template('list1',data);
			document.getElementById("tj1").innerHTML = banner;
		}
		}
	});
});
</script>

<script type="text/javascript">
	var page = 1;
	var max_page = {$count};
	var loading=false;
	//下拉加载
	$(window).scroll(function(){
	  if(loading || max_page==0){
		return;
	  }
	  var webheight = $(document).height();//网页高度
	  var top = document.documentElement.scrollTop + document.body.scrollTop; //滚动高度
	  if ((100 + $(window).scrollTop()) >= ($(document).height() - $(window).height())) {
		next();
	  }
	});
	function next(){
	  if(page >= max_page){
		$(".noData").show();
		return;
	  }
	  page++;
	  loading=true;
	  $(".noData").hide();
	  $(".loading").show();
	  var html="";
	  $.ajax({
		async: false,
		type:'get',
		url:'/api/user/paylog/?page='+page,
		dataType:'json',
		success:function(json){
		  $(".loading").hide();
		  loading=false;
		  if(json.code==200){
			$.each(json.cartoonrows,function(index,v){
				html += '<li><a href="javascript:;"><div class="rrr_li_txt"><div class="rrr_li_txt_tit"><strong>'+v.out_trade_no+'</strong><span>￥'+v.money+'</span></div><div class="rrr_li_txt_p"><strong>日期：'+v.create_time+'</strong><span>'+v.status+'</span></div></div></a></li>';
				
			});		
			$(".orders-list").append(html);
		  }else{
			$('.noData').show();
		  }          
		},
		error:function(){
		  loading=false;
		  $(".loading").hide();
		}
	  });
	}
	
</script>
{/block}